]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Use connectObject() for overview signals
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 19 Jan 2024 13:01:27 +0000 (14:01 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 19 Jan 2024 17:56:25 +0000 (17:56 +0000)
We expect top bar and activities button to be around for the
entire duration of the session, but some extra caution doesn't
hurt.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3126>

js/ui/panel.js

index 7318e95f084646a2450215e86f7c31524ab07a39..0309aa1a4960059a5c9e8964ea42582a09a12640 100644 (file)
@@ -427,12 +427,12 @@ class ActivitiesButton extends PanelMenu.Button {
 
         this.add_child(new WorkspaceIndicators());
 
-        Main.overview.connect('showing', () => {
-            this.add_style_pseudo_class('checked');
-        });
-        Main.overview.connect('hiding', () => {
-            this.remove_style_pseudo_class('checked');
-        });
+        Main.overview.connectObject('showing',
+            () => this.add_style_pseudo_class('checked'),
+            this);
+        Main.overview.connectObject('hiding',
+            () => this.remove_style_pseudo_class('checked'),
+            this);
 
         this._xdndTimeOut = 0;
     }
@@ -668,12 +668,12 @@ class Panel extends St.Widget {
         this.connect('button-press-event', this._onButtonPress.bind(this));
         this.connect('touch-event', this._onTouchEvent.bind(this));
 
-        Main.overview.connect('showing', () => {
-            this.add_style_pseudo_class('overview');
-        });
-        Main.overview.connect('hiding', () => {
-            this.remove_style_pseudo_class('overview');
-        });
+        Main.overview.connectObject('showing',
+            () => this.add_style_pseudo_class('overview'),
+            this);
+        Main.overview.connect('hiding',
+            () => this.remove_style_pseudo_class('overview'),
+            this);
 
         Main.layoutManager.panelBox.add_child(this);
         Main.ctrlAltTabManager.addGroup(this,